#include <iostream>
#include <stdio.h>
#include "mailt.h"

int main()
{

    std::string from = "18226802593@163.com";
    std::string passs ="TKsfeCHGDmyrM9YK";
    std::string to = "xxx@126.com";
    std::string subject = "hello";
    std::string strMessage = "test";


    std::vector<std::string> vecTo; //发送列表
    vecTo.push_back("2909307889@qq.com");

    std::vector<std::string> ccList;
    // ccList.push_back("xxx@xxx.com.cn");//抄送列表

    std::vector<std::string> attachment;
    // attachment.push_back("mail.h");
    // attachment.push_back("/home/soft/Desktop/openwrt-sdk-imx6ul/1/mybuild.sh");


    SmtpBase *base;
    SimpleSmtpEmail m_mail("smtp.163.com","25");
    base = &m_mail;
    //base->SendEmail(from, passs, to, subject, strMessage);//普通的文本发送，明文发送

    SimpleSslSmtpEmail m_ssl_mail("smtp.163.com","465");
    base=&m_ssl_mail;
    //base->SendEmail(from, passs, to, subject, strMessage);
    base->SendEmail(from, passs,vecTo,subject,strMessage,attachment,ccList);//加密的发送，支持抄送、附件等

    return 0;
}


